const obj = {
  "addCount": 0,
  "finishCount": 0,
  "percentage": "",
  "workType": ""
};
let isNeed = true;
const result = [];
for(let i in obj){
  const value = obj[i];
  let interfaceValue = "string";
  if(Array.isArray(value)){
    interfaceValue = "[]";
  }else if(typeof value == 'number'){
    interfaceValue = "number";
  }else if(typeof value == 'object'){
    interfaceValue = "{}";
  }
  result.push(`${i}${isNeed ? '' : '?'}: ${interfaceValue};`);
}
console.log(result.join("\n"));